#include <iostream>
#include <vector>

using namespace std;

int removeDuplicates(vector<int>& nums) {
    int k = nums.size();
    int slow = 1;
    for(int fast=1;fast<nums.size();fast++){
        if(nums[fast] != nums[fast-1]){
            nums[slow] = nums[fast];
            ++slow;
        }
    }
    return slow;
}

int main(){
    vector<int> nums;
    nums.push_back(1);
    nums.push_back(1);
    nums.push_back(2);
    cout << removeDuplicates(nums) << endl;
    return 0;
}